Skip to content

Conversation

@jimczi
Copy link
Contributor

@jimczi jimczi commented Jun 16, 2025

If the model settings is null then the field is guaranteed to not have any indexed content.

Closes #129501

If the model settings is null then the field is guaranteed to not have any indexed content.

Closes elastic#129501
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jun 16, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine
Copy link
Collaborator

Hi @jimczi, I've created a changelog YAML for you.

@jimczi jimczi requested a review from kderusso June 16, 2025 21:33
Copy link
Contributor

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the quick fix! I left one comment about cluster features.

Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for the quick fix

Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, Is the error happening silently? I tried with both sparse and dense vector in both ES3 and 8.17.2 but could not reproduce the error. I tried something like this:

PUT _inference/text_embedding/mistral-text_embedding
{
  "service": "mistral",
  "service_settings": {
        "model": "mistral-embed",
        "dimensions": 1024,
        "similarity": "dot_product",
        "rate_limit": {
            "requests_per_minute": 240
        },
        "api_key": "API_KEY"
    },
    "chunking_settings": {
        "strategy": "sentence",
        "max_chunk_size": 250,
        "sentence_overlap": 1
    }
}

PUT my-index
{
  "mappings": {
    "properties": {
      "keyword_field": {
        "type": "keyword"
      },
      "inference_field": {
        "type": "semantic_text",
        "inference_id": "mistral-text_embedding"
      }
    }
  }
}

POST my-index/_search
{
  "query": {
    "semantic": {
      "field": "inference_field",
      "query": "What is Elasticsearch?"
    }
  },
  "fields": ["_inference_fields"],
  "highlight": {
    "fields": {
      "inference_field": {} -- tried with `type=semantic` as well
    }
  }
}

@kderusso
Copy link
Member

@kderusso So cluster feature is only required when we are back-porting?

Good question. I think it's OK if the bug hasn't been ported to Serverless?

@jimczi
Copy link
Contributor Author

jimczi commented Jun 17, 2025

@Samiul-TheSoccerFan your reproduction query doesn't return any document. Try with this:

POST my-index/_search
{
  "query": {
     "match_all": {}
  },
  "fields": ["_inference_fields"],
  "highlight": {
    "fields": {
      "inference_field": {} -- tried with `type=semantic` as well
    }
  }
}

@jimczi jimczi added the auto-backport Automatically create backport pull requests when merged label Jun 17, 2025
@jimczi jimczi merged commit 505824d into elastic:main Jun 17, 2025
24 checks passed
@jimczi jimczi deleted the semantic_highlighter_null_model_settings branch June 17, 2025 18:17
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19

jimczi added a commit to jimczi/elasticsearch that referenced this pull request Jun 17, 2025
If the model settings is null then the field is guaranteed to not have any indexed content.

Closes elastic#129501
elasticsearchmachine pushed a commit that referenced this pull request Jun 17, 2025
If the model settings is null then the field is guaranteed to not have any indexed content.

Closes #129501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Search Relevance/Search Catch all for Search Relevance Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPE in SemanticTextHighlighter

5 participants